<template>
  <div>
    <h1>您好 本店提供以下服务</h1>

    <div>
      <el-row :gutter="20">
        <el-col :span="6"
          ><div class="grid-content bg-purple">
            <div class="grid-content bg-purple">每日疫情打卡</div>
            <el-input
              v-model="data.temp"
              style="width: 240px; margin-top: 20px"
              placeholder="请输入当前温度"
            ></el-input>
          </div>

          <el-button style="margin-top: 20px" @click="daka" type=""
            >提交</el-button
          >
          <div style="margin-top: 20px"><h1>查看上次温度打卡是否通过</h1></div>

          <div style="margin-top: 20px">
            <el-button @click="chenggong" type="">查询</el-button>
          </div>
          <div>
            <p>{{ this.isa }}</p>
          </div>
        </el-col>
        <el-col :span="6"
          ><div class="grid-content bg-purple">
            <span>打扫或者换床单 啥啥啥</span>
          </div>
          <el-button style="margin-top: 20px" size="medium" round @click="qqds"
            >请求工作人员</el-button
          >
        </el-col>
        <el-col :span="6"
          ><div class="grid-content bg-purple">
            <div><span>你想吃什么</span></div>
            <el-select
              style="margin-top: 20px"
              v-model="value"
              placeholder="请选择"
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
            <div>
              <el-button style="margin-top: 20px" @click="tijiao" type=""
                >提交</el-button
              >
            </div>
          </div></el-col
        >
        <el-col :span="6"
          ><div class="grid-content bg-purple">
            <div><span>你想说些啥到前台</span></div>
            <el-input
              style="margin-top: 20px"
              type="textarea"
              :rows="2"
              placeholder="请输入内容"
              v-model="textarea"
            >
            </el-input>
            <div>
              <el-button style="margin-top: 20px" @click="tijiao1" type=""
                >提交</el-button
              >
            </div>
          </div></el-col
        >
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "guest",
  data() {
    return {
      textarea: "",
      data: {
        idCard: "",
        temp: "",
      },
      input1: "",
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      value: "",
      isa: "",
    };
  },
  props: ["id"],
  mounted() {
    this.data.idCard = this.$route.query.id;
  },
  methods: {
    async chenggong() {
      let result = await this.$API.myapi.reqPunchFindPass(this.data.idCard);
      if (result.data.code == 20000) {
        this.isa = "通过";
      }
      if (result.data.code == 40000) {
        this.isa = "不通过";
      }
    },
    async daka() {
      console.log(this.data);
      let result = await this.$API.myapi.reqaddPunch(this.data);
      console.log(result, "添加成功");
      if (result.data.code == 20000) {
        this.$message({
          message: "温度记录成功！",
          type: "success",
        });
      }
    },
    qqds() {
      this.$message({
        message: "已经呼叫前台工作人员 请等候",
        type: "success",
      });
    },
    tijiao() {
      this.$message({
        message: "后厨准备中，请等候",
        type: "success",
      });
    },
    tijiao1() {
      this.$message({
        message: "已发送到前台",
        type: "success",
      });
    },
  },
};
</script>
<style>
.asd {
}
</style>